<?php


/**
 * APP接口
 */



/**
 * 视频接口
 */
$router->group(['prefix'=>'video'], function () use ($router) {
    $router->post('index','VideoController@getHistory');
    $router->post('one','VideoController@getOne');
    $router->post('history/del','VideoController@setHistoryDel');
    $router->post('zan/add','VideoController@setZanAdd');
    $router->post('zan/del','VideoController@setZanDel');
    $router->post('collect/add','VideoController@setCollectAdd');
    $router->post('collect/del','VideoController@setCollectDel');
});

/**
 * 库接口
 */
$router->group(['prefix'=>'stock'], function () use ($router) {
    $router->post('index','StockController@getHistory');
    $router->post('one','StockController@getOne');
    $router->post('history/del','StockController@setHistoryDel');
    $router->post('zan/add','StockController@setZanAdd');
    $router->post('zan/del','StockController@setZanDel');
    $router->post('collect/add','StockController@setCollectAdd');
    $router->post('collect/del','StockController@setCollectDel');
    $router->group(['namespace'=>'Stock'], function () use ($router) {
        //加入创作
        $router->post('plus/index', 'PlusController@getIndex');
        $router->post('plus/add', 'PlusController@setAdd'); //新增创作
        //创板
        $router->post('board/add', 'BoardController@setAdd'); //创板素材记录
        //创板素材
        $router->post('source/index', 'SourceController@getIndex'); //素材列表
        $router->post('source/modify', 'SourceController@setUpdate'); //更新图片文字
        //渲染申请
        $router->post('render/add', 'RenderController@setAdd');
    });
});

/**
 * 用户接口
 */
$router->group(['prefix'=>'user'], function () use ($router) {
    $router->post('regist','UserController@doRegist'); //注册
    $router->post('login','UserController@doLogin'); //登陆
    $router->post('yzm/send','UserController@sendYzm'); //发送验证码
    $router->post('nick','UserController@setNick'); //更新昵称
    $router->post('pwd','UserController@setPwd'); //更新密码
    $router->post('head/tmp','UserController@setHeadTmp'); //头像上传临时设置
    $router->post('head/modify','UserController@setHeadUpdate'); //头像上传更新
    $router->post('headbg/tmp','UserController@setHeadBgTmp'); //头像背景上传临时设置
    $router->post('headbg/modify','UserController@setHeadBgUpdate'); //头像背景上传更新
});

/**
 * 用户建议
 */
$router->group(['prefix'=>'opinion'], function () use ($router) {
    $router->post('index','OpinionController@getIndex');
    $router->post('add','OpinionController@setAdd');
});

/**
 * 系统参数
 */
//$router->post('sys/index','SysController@getIndex');
$router->post('sys/modify','SysController@setUpdate');

/**
 * APP版本
 */
$router->group(['prefix'=>'version'], function () use ($router) {
    $router->post('index','AppVersionController@getIndex');
    $router->post('new','AppVersionController@getNewOne'); //获取最新版
    $router->post('total/modify','AppVersionController@setDownloadTotal'); //更新下载量
});

/**
 * 文件上传
 */
$router->post('upload/file','UploadController@setUploadFile');

/**
 * 奖励
 */
$router->group(['prefix'=>'reward', 'namespace'=>'Reward'], function () use ($router) {
    //签到
    $router->post('sign/index','SignController@getIndex');
    $router->post('sign/add','SignController@setAdd');
    //摇一摇
    $router->post('shake/index','ShakeController@getIndex');
    $router->post('shake/add','ShakeController@setAdd');
    //扫码
    $router->post('scan/index','ScanController@getIndex');
    $router->post('scan/add','ScanController@setAdd');
    //刮奖
    $router->post('draw/index','DrawController@getIndex');
    $router->post('draw/add','DrawController@setAdd');
});